<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title><控制器></title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/google-code-prettify@1.0.5/bin/prettify.min.css">
    <link rel="stylesheet" href="style.css">
     <script src="jquery-3.2.1.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
<link href="https://cdn.bootcss.com/element-ui/2.13.2/theme-chalk/index.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/element-ui/2.13.2/index.js"></script> 
</head>
<body onload="PR.prettyPrint()">
<nav class="navbar">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.html">
                interface-test
            </a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="https://gitee.com/zk66/resultfulInterfaceTest" target="_blank">Gitee</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">V1.0<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                            <li><a href="../interface-test/index.html">interface-test</a></li>
                            <li><a href="../LICENSE/index.html">LICENSE</a></li>
                            <li><a href="../README.en.md/index.html">README.en.md</a></li>
                            <li><a href="../README.md/index.html">README.md</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="book with-summary" id="app">
    <div class="book-summary">
<div class="search-box form-group">
    <input type="text" class="form-control" id="inputSearch" placeholder="搜索接口">
    <span class="glyphicon glyphicon-search form-control-feedback" aria-hidden="true"></span>
</div>
<div id="accordion" class="catalog">
            <div class="panel">
            <div id="heading1" data-parent="#accordion" class="catalog-title" data-toggle="collapse"
                 aria-expanded="true" data-target="#collapse1" aria-controls="collapse1">
                <i class="glyphicon glyphicon-align-justify" @click="submit"></i> <在线生成>
            </div>
            <div id="collapse1" class="collapse " aria-labelledby="heading1">
                    <a class="catalog-item" @click="submit('text')">
                        文本
                    </a>
                     <a class="catalog-item" @click="submit('git')">
                        远程git仓库
                    </a>
                     <a class="catalog-item" @click="submit('git')">
                        服务器路径
                    </a>
            </div>
        </div>
        <div class="panel">
            <div id="heading0" data-parent="#accordion" class="catalog-title" data-toggle="collapse"
                 aria-expanded="true" data-target="#collapse0" aria-controls="collapse0">
                <i class="glyphicon glyphicon-align-justify"></i> <在线文档>
            </div>
            <div id="collapse0" class="collapse in " aria-labelledby="heading0">
                    <a v-for="item in model" class="catalog-item" @click="checked(item)">
                        {{item.name}}|{{item.remark}}
                    </a>
                   
            </div>
        </div>
</div>    </div>
    <div class="book-body" v-if="active==1">
        <div class="body-inner">
            <div class="book-header">
                <div class="d-flex justify-content-between">
                    <a class="header-menu toggle-catalog" href="javascript:void(0)"><i
                            class="glyphicon glyphicon-align-justify"></i> 目录</a>
                </div>
            </div>
            <div class="page-wrapper">
                <div class="page-inner">
                    <div v-for="item in controller.method" class="action-list">
                        <div class="action-item">
<h2 id="download"><a href="#">{{item.methodName}}|{{item.methodRemark}} </a></h2>
    <p class="text-muted"><em>作者: {{controller.author}}</em></p>
<p><strong>请求URL</strong></p>
<p>
    <code>{{item.methodUrl}}</code>
        <span class="label label-default">{{item.methodType}}</span>
</p>
<p><strong>示例URL</strong></p>
<p>
    <code>{{item.methodRealUrl}}</code>
        <span class="label label-default">{{item.methodType}}</span>
</p>
    <p><strong>请求参数</strong></p>
        <table class="table table-bordered">
            <tr>
                <th>参数名</th>
                <th>类型</th>
                <th>必须</th>
                <th>示例值</th>
                <th>描述</th>
            </tr>
                <tr v-for="param in item.methodParam">
                    <td>{{param.paramName}}</td>
                    <td>{{param.paramType}}</td>
                    <td>{{param.paramNeed}}</td>
                    <td>{{param.paramValue}}</td>
                    <td>{{param.paramRemark}}</td>
                </tr>
        </table>
            <p><strong>返回类型</strong></p>
    <pre class="prettyprint lang-json">{{item.methodReturn}}</pre>
     <p><strong>返回说明</strong></p>
    <pre class="prettyprint lang-json">{{item.methodReturnRemark}}</pre>
    <p><strong>示例返回</strong></p>
    <pre class="prettyprint lang-json">{{item.methodRunresult}}</pre>
                        </div>
                        <hr>
                    </div>
                </div>
            </div>
        </div>
    </div>
     <div v-else-if="active==2" class="book-body">
         <iframe src="index.html" style="width: 100%;height: 100%;"></iframe>
    </div>
        <div v-else class="book-body">
        <div class="body-inner">
            <div class="book-header">
                <div class="d-flex justify-content-between">
                    <a class="header-menu toggle-catalog" href="javascript:void(0)"><i
                                class="glyphicon glyphicon-align-justify"></i> 目录</a>
                </div>
            </div>
            <div class="page-wrapper">
                <div class="page-inner">
                    <div class="main-content">
                        <!--<img src="http://static.nowait.xin/pic/japidocs-logo.png" width="200" height="200">-->
                        <h4 style="margin: 20px">本接口自动生成利用正则表达式，目前支持提交控制器文本，服务器仓库路径,远程仓库3种，只要符合示例规范的resultful控制器均可使用该方式生成文档</h4>
                        <div class="list-group" style="min-width: 200px">
                                <a @click="submit('text')" class="list-group-item"><在线生成></a>
                                
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
   
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/google-code-prettify@1.0.5/bin/prettify.min.js"></script>

<script>
    var search_source_data = [
            {name: '<控制器>.<示例接口>', url: 'com_zk_springboot_abcController.html#download'},
            {name: '<控制器>.<示例接口>', url: 'com_zk_springboot_abcController.html#download1'},
            {name: 'TestController.setKey', url: 'com_zk_springboot_TestController.html#setKey'},
    ];



    $('.toggle-catalog').click(function () {
        $('.book').toggleClass('with-summary');
    });

    $('#inputSearch').autocomplete({hint: false}, [
        {
            source: function (query, callback) {
                var result = [];
                for(var i = 0; i !== search_source_data.length; i++){
                    if(search_source_data[i].name.indexOf(query) !== -1){
                        result.push(search_source_data[i]);
                    }
                }
                callback(result);
            },
            displayKey: 'name',
            templates: {
                suggestion: function (suggestion) {
                    return suggestion.name;
                }
            }
        }
    ]).on('autocomplete:selected', function (event, suggestion, dataset, context) {
        self.location = suggestion.url;
    });
</script>
    <script type="text/javascript">
var vue = new Vue({
            el: '#app',
            data: {
                active:0,
                controller:[],
                model:[],
            },
             mounted: function () {
                //this.model=interface_data_json;
             },
            methods: {
                checked(item){
                    this.controller=item
                    this.active=1;
                },
                submit(type){
                    this.active=2;
                },
                handleClick(row) {
        console.log(row);
      },
            }
        })
</script>


</body>
</html>